#include "image_db.h"

#include "core/debug.h"

namespace oet {
using namespace oe;
void ImageDBTest() {
  debug::Info("Begin ImageDBTest");

  ImageDbServerPtr server = ImageDbServer::GetServer();
  int db_id = server->NewDb("test");
  ImageDbPtr db = server->GetDb(db_id);

  const char *test_file = "/media/E/workspace/image/scene/scene (11).jpg";
  const char *db_path = "/media/E/workspace/image/scene/";
  
  db->AddImageFolder(db_path);
  
  ImageDb::ResultList result;
  db->Query(test_file, ImageDb::QueryParam(0, false, 12), result);

  for (ImageDb::ResultIt it = result.begin(); it != result.end(); ++it) {
    debug::Info("%d, %f, %s\n", it->img_id, it->score,
           db->GetImageFile(it->img_id).c_str());
  }
}
} // oet
